#ifndef UDPCLIENT_H
#define UDPCLIENT_H

#include <QObject>
class QUdpSocket;
class QTcpSocket;
class CmdThread;
class SysInfo;
class QHostAddress;

class UdpClient : public QObject
{
    Q_OBJECT
public:
    explicit UdpClient(QObject *parent = 0);
    ~UdpClient();

signals:

public slots:
    void dataReceived_socket_1();
    void dataReceived_socket_2();
    void onTcpserver_newConnect();
    void onTcpserver_dataReceived();
    void onTcpserver_disConnect();
    void onCmdStatChanged(QString cmdstr, int stat);

private:
    QList<CmdThread* > cmdThreadList;
    QUdpSocket  *udpsocket;
    QTcpSocket  *tcpsocket;
    SysInfo     *sysinfo;
    int socket_port;
    QString hostIP;

    void processUdpData(int port_comm);
    void processTcpData();
    void processRecvData(QByteArray &datagram, QHostAddress &hostAddress, int port_comm);
};

#endif // UDPCLIENT_H
